/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.apt.answer;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 *
 * @author Bach
 */
public class AnswerForm extends org.apache.struts.action.ActionForm {

    private String fbcontent;
    private String fbanswer;
    private String adminid;
    private String userid;

    public AnswerForm() {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * This is the action called from the Struts framework.
     *
     * @param mapping The ActionMapping used to select this instance.
     * @param request The HTTP Request we are processing.
     * @return
     */
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
        if (getFbanswer() == null || getFbanswer().length() < 1) {
            errors.add("anmss", new ActionMessage("error.AnswerForm.answer.required"));
            // TODO: add 'error.name.required' key to your resources
        }
        return errors;
    }

    /**
     * @return the fbcontent
     */
    public String getFbcontent() {
        return fbcontent;
    }

    /**
     * @param fbcontent the fbcontent to set
     */
    public void setFbcontent(String fbcontent) {
        this.fbcontent = fbcontent;
    }

    /**
     * @return the fbanswer
     */
    public String getFbanswer() {
        return fbanswer;
    }

    /**
     * @param fbanswer the fbanswer to set
     */
    public void setFbanswer(String fbanswer) {
        this.fbanswer = fbanswer;
    }

    /**
     * @return the adminid
     */
    public String getAdminid() {
        return adminid;
    }

    /**
     * @param adminid the adminid to set
     */
    public void setAdminid(String adminid) {
        this.adminid = adminid;
    }

    /**
     * @return the userid
     */
    public String getUserid() {
        return userid;
    }

    /**
     * @param userid the userid to set
     */
    public void setUserid(String userid) {
        this.userid = userid;
    }
}
